package de.tto.dating.servlet;

import java.io.IOException;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.blobstore.BlobKey;
import com.google.appengine.api.blobstore.BlobstoreService;
import com.google.appengine.api.blobstore.BlobstoreServiceFactory;

public class ScaleImage extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3674645516073490781L;
	
	private BlobstoreService blobstoreService = BlobstoreServiceFactory
	.getBlobstoreService();

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {

		
		Map<String, BlobKey> blobs = blobstoreService.getUploadedBlobs(req);
		BlobKey blobKey = blobs.get("upload_foto");

		if (blobKey == null) {
			resp.sendRedirect("/");
			return;
		}
		
		System.out.println("Scale...");

	}
}
